@extends(config('admin.systems.layout_blade'))

@section('content')
<div class="error-page">
    <h2 class="headline text-red">{{ $code }}</h2>

    <div class="error-content">
        <h3><i class="fa fa-warning text-red"></i> {{ $msg }}</h3>

        <p>
            页面自动 <a id="href" href="{{ empty($url) ? 'javascript:void(0)' : $url }}" >跳转</a> 等待时间： <b id="wait">{{ $wait }}</b>
        </p>

        <!--<form class="search-form">
            <div class="input-group">
                <input type="text" name="search" class="form-control" placeholder="Search">

                <div class="input-group-btn">
                    <button type="submit" name="submit" class="btn btn-danger btn-flat"><i class="fa fa-search"></i>
                    </button>
                </div>
            </div>
        </form>-->
    </div>
</div>
@endsection

@section('script')
    <script>
        (function(){
            var wait = document.getElementById('wait'),
                href = document.getElementById('href').href;

                var interval = setInterval(function(){
                    var time = --wait.innerHTML;
                    if(time <= 0) {
                        if (href == 'javascript:void(0)') {
                            window.history.go(-1);
                        } else {
                            location.href = href;
                        }

                        clearInterval(interval);
                    };
                }, 1000);
        })();
    </script>
@endsection
